package me.firstapp.module.shop;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import me.firstapp.module.base.CommonEntity;
import me.firstapp.module.bbs.Member;

@Entity
@Table(name = "MEMBER_ADDRESS")
public class Address extends CommonEntity {

	private static final long serialVersionUID = 8886096431285590153L;

	// 关联的用户
	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MEMBER_ID", referencedColumnName = "ID", unique = true, nullable = false)
	private Member member;

	//收货人姓名
	@Column(name = "NAME", length = 20, nullable = false)
	private String name;

	//手机号
	@Column(name = "MOBILE", length = 11, nullable = false)
	private String mobile;

	//省
	@Column(name = "PROVINCE", length = 30, nullable = false)
	private String province;

	//市
	@Column(name = "CITY", length = 30, nullable = false)
	private String city;

	//区
	@Column(name = "DISTRICT", length = 30, nullable = false)
	private String district;

	//详细地址
	@Column(name = "DETAIL", length = 200, nullable = false)
	private String detail;

	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getDistrict() {
		return district;
	}

	public void setDistrict(String district) {
		this.district = district;
	}

	public String getDetail() {
		return detail;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}

}
